package kite.springcloud.common.stream;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;

/**
 * Processor接口既定义输入通道又定义了输出通道
 *
 * @author houxiurong
 * @date 2020/5/9
 */
public interface UserChannelProcess {
    /**
     * 发消订阅的通道名称
     */
    String USER_TOPIC_OUTPUT = "user_output";

    /**
     * 发消订阅的通道名称
     */
    String USER_TOPIC_INPUT = "user_input";

    /**
     * 发User消息的通道
     *
     * @return
     */
    @Output(USER_TOPIC_INPUT)
    MessageChannel sendUserMessage();

    /**
     * 收User消息的通道
     *
     * @return SubscribableChannel
     */
    @Input(USER_TOPIC_OUTPUT)
    SubscribableChannel receiveUserMessage();
}
